<template>
  <div>
    <van-sticky :offset-top="1">
       <div id="header" class="aui-bg-red aui-padded-10"></div>
    </van-sticky>
    <div id="main">
        <div style="position: fixed;left: 0;top: 20px;z-index: 999">
          <div id="back" class="back aui-text-center aui-padded-15 aui-padded-t-0">
              <div class="back-cont aui-bg-red aui-margin-t-10" @click="back">
                  <i class="iconfont icon-fanhui aui-text-f aui-ftn16"></i>
              </div>
          </div>
        </div>
        <div v-if="!answer.isTotal" v-cloak>
            <div class="banner">
                <div id="aui-slide" class="slider_m">
                    <div class="slide-img" v-bind:style="{backgroundImage:'url(' + answer.data.image + ')'}" @click="fnPreview(answer.data.image)"></div>
                </div>
            </div>

            <div class="content aui-bg-f">
                <div class="top aui-padded-10">
                    <div class="name aui-ftn14 aui-text-3">
                      <img src="../../assets/tb_icon.png" alt="" v-if="answer.data.type == 1">
                      <img src="../../assets/tm_icon.png" alt="" v-if="answer.data.type == 2">
                      <img src="../../assets/jd_icon.png" alt="" v-if="answer.data.type == 3">
                      <img src="../../assets/pdd_icon.png" alt="" v-if="answer.data.type == 4">
                      <img src="../../assets/al_icon.png" alt="" v-if="answer.data.type == 5">
                      <div class="aui-ellipsis-2 aui-padded-l-5" v-text="answer.data.question"></div>
                    </div>
                    <van-row class="bb">
                        <van-col span="12">
                            <span class="aui-ftn12 aui-text-7">赚￥</span><span class="aui-ftn18 aui-text-red" v-text="answer.data.red"></span>
                        </van-col>
                        <van-col span="12">
                            <span class="aui-ftn12 aui-text-7">活动ID:</span>&nbsp;<span class="aui-ftn18 aui-text-red" v-text="answer.data.id"></span>
                        </van-col>
                    </van-row>
                </div>
                <div class="bottom">
                    <van-row class="aui-padded-b-10">
                        <van-col span="8">
                            <span class="aui-ftn12 aui-text-7">剩余</span>&nbsp;<span class="aui-ftn14 aui-text-3">{{answer.data.exitnum}}份</span>
                        </van-col>
                        <van-col span="8">
                            <span class="aui-ftn12 aui-text-7">总数</span>&nbsp;<span class="aui-ftn14 aui-text-3">{{answer.data.num}}份</span>
                        </van-col>
                        <van-col span="8">
                            <span class="aui-ftn12 aui-text-7">下单价</span>&nbsp;<span class="aui-ftn14 aui-text-3">{{answer.data.price}}元</span>
                        </van-col>
                    </van-row>
                    <div class="tag">
                        <div class="aui-label aui-label-danger aui-margin-r-5" v-for="(item, index) in answer.data.label" v-text="item"></div>
                    </div>
                </div>
            </div>
            <div class="tab aui-bg-f">
                <div class="tab_top">
                    <van-row class="aui-text-center">
                        <van-col span="12" class="item aui-ftn14 aui-text-7" v-bind:class="{'active': tab.cur == 0}" @click="tab.cur = 0" v-cloak>
                            找答案
                        </van-col>
                        <van-col span="12" class="item aui-ftn14 aui-text-7" v-bind:class="{'active': tab.cur == 1}" @click="tab.cur = 1" v-cloak>
                            作答记录
                        </van-col>
                    </van-row>
                </div>
                <div class="tab_cont">
                    <div class="tab_desc api-padded-10" v-if="tab.cur == 0" v-cloak>
                    <!-- 已登录 -->
                        <div class="aui-padded-15" v-if="answer.isLogin" v-cloak>
                            <div class="aui-text-center aui-text-red aui-ftn16 aui-padded-t-15 aui-padded-b-15" v-if="answer.data.status  == 2" v-cloak>已获得{{answer.data.red}}元奖励！</div>
                            <div class="title aui-ftn16 aui-font-weight aui-padded-t-10">参加要求</div>
                            <div class="desc aui-text-7 aui-ftn14 aui-padded-t-10" style="line-height: 28px">
                                1、您的IP是<span v-text="answer.data.ip"></span>，重复ip不能参加，重复ip不能参加<br>
                                2、获得资格后按照搜索条件找到商品<br>
                                3、在店铺浏览本商品3分钟以上，找到并填写答案，答案正确立即获得奖励<br>
                                4、禁止搜索店铺进入，禁止未搜索填写答案<br>
                                5、商家全程量子监控您的IP，商家投诉举报则封号处理，扣除日赚任务所得奖励
                            </div>
                            <div class="aui-ftn16 aui-text-7 aui-text-center" v-if="!answer.data.status" style="padding: 30px 0" v-cloak>获得作答资格后显示找答案步骤！</div>
                            <div v-if="answer.data.order_id" v-cloak>
                                <div class="sk_pass aui-bg-f aui-margin-t-10 aui-padded-10">
                                    <div class="title aui-text-3 aui-font-weight aui-text-left aui-ftn16 aui-padded-t-10">作答详情</div>
                                    <div class="content aui-margin-t-15">
                                        <!-- 不是电脑端 -->
                                        <div class="item aui-padded-t-10 aui-padded-b-10 aui-border-b" v-if="answer.data.mode != 5">
                                            <van-row class="aui-ftn14">
                                                <van-col span="2" class="aui-text-7">
                                                    1、
                                                </van-col>
                                                <van-col span="22" class="aui-text-6">
                                                    打开<span class="aui-text-red" v-text="answer.data.typename"></span>,登录帐号：<span class="aui-text-red" v-text="answer.data.username"></span>
                                                </van-col>
                                            </van-row>
                                        </div>
                                        <!-- 电脑端 -->
                                        <div class="item aui-padded-t-10 aui-padded-b-10 van-hairline--bottom" v-if="answer.data.mode == 5" v-cloak>
                                            <van-row class="aui-ftn14">
                                                <van-col span="2" class="aui-text-7">
                                                    1、
                                                </van-col>
                                                <van-col span="22">
                                                    <div class="aui-padded-b-5">
                                                        <div class="aui-btn aui-btn-warning" id="url" data-clipboard-action="copy" :data-clipboard-text="answer.data.url"  @click="fnCopyText('#url')">复制</div>
                                                        <span class="aui-text-7">,去浏览器打开参加试用(<span v-text="answer.data.typename"></span>)</span>
                                                    </div>
                                                    <div class="aui-text-7" v-text="answer.data.url"></div>
                                                </van-col>
                                            </van-row>
                                        </div>
                                        <div v-if="answer.data.mode == 1 || answer.data.mode == 2">
                                            <div class="item aui-padded-t-10 aui-padded-b-10 aui-border-b">
                                                <van-row class="aui-ftn14">
                                                    <van-col span="2" class="aui-text-7">
                                                        2、
                                                    </van-col>
                                                    <van-col span="22">
                                                        <div class="aui-text-7">搜索关键词:<span class="aui-text-red" v-text="answer.data.keyword.key"></span>
                                                        <span class="aui-text-7 aui-padded-5 aui-ftn12">(请手动输入关键词,不可复制)</span>
                                                        </div>
                                                        <div class="aui-btn aui-btn-warning aui-margin-t-10" @click="fnChangeKeyWord">换个关键词</div>
                                                    </van-col>
                                                </van-row>
                                            </div>

                                            <div class="item aui-padded-t-10 aui-padded-b-10 aui-border-b">
                                                <van-row class="aui-ftn14">
                                                    <van-col span="2" class="aui-text-7">
                                                        3、
                                                    </van-col>
                                                    <van-col span="22">
                                                        <span class="aui-text-7">选择排序:</span><span class="aui-text-red aui-padded-l-10" v-text="answer.data.keyword.sort"></span>
                                                    </van-col>
                                                </van-row>
                                            </div>

                                            <div class="item aui-padded-t-10 aui-padded-b-10 aui-border-b">
                                                <van-row class="aui-ftn14">
                                                    <van-col span="2" class="aui-text-7">
                                                        4、
                                                    </van-col>
                                                    <van-col span="22">
                                                        <span class="aui-text-7">大概第几屏:</span><span class="aui-text-red aui-padded-l-10" v-text="answer.data.keyword.page"></span>
                                                    </van-col>
                                                </van-row>
                                            </div>
                                        </div>

                                        <div class="item aui-padded-t-10 aui-padded-b-10 aui-border-b" v-if="answer.data.mode == 3">
                                            <van-row class="aui-ftn14">
                                                <van-col span="2" class="aui-text-7">
                                                    2、
                                                </van-col>
                                                <van-col span="22">
                                                    <span class="aui-text-7">二维码:</span>
                                                    <van-row class="aui-padded-t-10">
                                                        <van-col span="12">
                                                            <div class="good-img" v-bind:style="{backgroundImage:'url(' + answer.data.qrcode_image + ')'}" @click="fnPreview(answer.data.qrcode_image, 0)"></div>
                                                        </van-col>
                                                    </van-row>
                                                </van-col>
                                            </van-row>
                                        </div>

                                        <div class="item aui-padded-t-10 aui-padded-b-10 aui-border-b" v-if="answer.data.mode == 4">
                                            <van-row class="aui-ftn14">
                                                <van-col span="2" class="aui-text-7">
                                                    2、
                                                </van-col>
                                                <van-col span="22">
                                                    <span class="aui-text-7">淘口令:</span>
                                                    <span class="aui-text-red aui-padded-l-10" v-text="answer.data.tkl"></span>
                                                    <div class="aui-btn aui-btn-danger" id="tkl" data-clipboard-action="copy" :data-clipboard-text="answer.data.tkl"  @click="fnCopyText('#tkl')">复制</div>
                                                </van-col>
                                            </van-row>
                                        </div>

                                        <div class="item aui-padded-t-10 aui-padded-b-10 aui-border-b">
                                            <van-row class="aui-ftn14">
                                                <van-col span="2" class="aui-text-7">
                                                    <span v-if="answer.data.mode != 1 && answer.data.mode != 2 && answer.data.mode != 3">2</span>
                                                    <span v-if="answer.data.mode == 1 || answer.data.mode == 2">5</span>
                                                    <span v-if="answer.data.mode == 3">3</span>、
                                                </van-col>
                                                <van-col span="22">
                                                    <span class="aui-text-7">核对店铺名:</span><span class="aui-text-red aui-padded-l-10" v-text="answer.data.storename"></span>
                                                    <div class="aui-btn aui-btn-warning aui-margin-t-10 aui-margin-l-5" @click="fnCheck(1)">手动核对店铺</div>
                                                    <div class="aui-ftn12 aui-text-red aui-padded-t-5">    下单前请核对店铺名，防止误购其它店铺商品！
                                                    </div>
                                                </van-col>
                                            </van-row>
                                        </div>

                                        <div class="item aui-padded-t-10 aui-padded-b-10 aui-border-b" v-if="answer.data.min">
                                            <van-row class="aui-ftn14">
                                                <van-col span="2" class="aui-text-7">
                                                    <span v-if="answer.data.mode != 1 && answer.data.mode != 2 && answer.data.mode != 3">3</span>
                                                    <span v-if="answer.data.mode == 1 || answer.data.mode == 2">6</span>
                                                    <span v-if="answer.data.mode == 3">4</span>、
                                                </van-col>
                                                <van-col span="22">
                                                    <span class="aui-text-7">最低价:</span><span class="aui-text-red aui-padded-l-10" v-text="answer.data.min"></span>
                                                </van-col>
                                            </van-row>
                                        </div>
                                        <div class="item aui-padded-t-10 aui-padded-b-10 aui-border-b" v-if="answer.data.max">
                                            <van-row class="aui-ftn14">
                                                <van-col span="2" class="aui-text-7">
                                                    <span v-if="answer.data.mode != 1 && answer.data.mode != 2 && answer.data.mode != 3">4</span>
                                                    <span v-if="answer.data.mode == 1 || answer.data.mode == 2">7</span>
                                                    <span v-if="answer.data.mode == 3">5</span>、
                                                </van-col>
                                                <van-col span="22">
                                                    <span class="aui-text-7">最高价:</span><span class="aui-text-red aui-padded-l-10" v-text="answer.data.max"></span>
                                                </van-col>
                                            </van-row>
                                        </div>
                                        <div class="item aui-padded-t-10 aui-padded-b-10 aui-border-b" v-if="answer.data.address">
                                            <van-row class="aui-ftn14">
                                                <van-col span="2" class="aui-text-7">
                                                    <span v-if="answer.data.mode != 1 && answer.data.mode != 2 && answer.data.mode != 3">5</span>
                                                    <span v-if="answer.data.mode == 1 || answer.data.mode == 2">8</span>
                                                    <span v-if="answer.data.mode == 3">6</span>、
                                                </van-col>
                                                <van-col span="22">
                                                    <span class="aui-text-7">发货地:</span><span class="aui-text-red aui-padded-l-10" v-text="answer.data.address"></span>
                                                </van-col>
                                            </van-row>
                                        </div>
                                    </div>
                                </div>
                                <div class="sk_pass aui-bg-f aui-margin-t-10 aui-padded-10 aui-margin-b-15">
                                    <div class="title aui-text-3 aui-font-weight aui-ftn16 aui-padded-t-10">注意事项</div>
                                    <div class="content aui-margin-t-15">
                                        <div class="item aui-padded-t-10 aui-padded-b-10 aui-border-b">
                                            <div class="aui-ftn14">
                                                <span class="aui-text-7">
                                                    收藏宝贝:
                                                </span>
                                                <span class="aui-padded-l-10 aui-text-red">
                                                    需要
                                                </span>
                                            </div>
                                        </div>
                                        <div class="item aui-padded-t-10 aui-padded-b-10 aui-border-b">
                                            <div class="aui-ftn14">
                                                <span class="aui-text-7">
                                                    加入购物车:
                                                </span>
                                                <span class="aui-padded-l-10 aui-text-red">
                                                    需要
                                                </span>
                                            </div>
                                        </div>
                                        <div class="item aui-padded-t-10 aui-padded-b-10 aui-border-b">
                                            <div class="aui-ftn14 aui-text-7">
                                                <span v-if="!answer.data.is_card">允许</span><span v-if="answer.data.is_card">禁止</span>信用卡支付  <span v-if="!answer.data.is_hua">允许</span><span v-if="answer.data.is_hua">禁止</span>花呗支付
                                            </div>
                                        </div>
                                        <div class="tags aui-padded-t-10 aui-padded-b-10">
                                            <div style="word-wrap:break-word;word-break:break-all" v-html="answer.data.content">
                                            </div>
                                        </div>
                                    </div>
                                </div>

                            </div>
                        </div>
                        <!-- 未登录 -->
                        <div class="sign aui-bg-f" v-if="!answer.isLogin" v-cloak>
                            <van-row>
                                <van-col span="12">
                                    <div class="login_btn aui-ftn14 aui-text-red aui-text-center"  @click="fnOpenLogin">
                                        登录
                                    </div>
                                </van-col>
                                <van-col span="12">
                                    <div class="register_btn aui-ftn14 aui-text-f aui-bg-red aui-text-center" @click="fnOpenRegister">
                                        注册
                                    </div>
                                </van-col>
                            </van-row>
                        </div>
                    </div>
                    <div class="tab_record" v-if="tab.cur == 1"  v-cloak>
                        <van-row v-if="users.length > 0" v-cloak>
                            <van-col span="6" v-for="(item, index) in users" :key="index">
                                <div class="item">
                                    <div class="avatar" :style="{backgroundImage:'url(' + item.avatar + ')'}"></div>
                                    <div class="aui-padded-t-5 name aui-ftn12 aui-text-7 aui-text-center van-ellipsis" v-text="item.nickname"></div>
                                </div>
                            </van-col>
                        </van-row>
                        <div v-if="users.length == 0" v-cloak>
                            <div class="no-data aui-bg-f aui-text-center aui-text-9">
                                <i class="iconfont icon-lujing1161"></i>
                                <div class="aui-ftn16">
                                    空空如也~
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div v-if="!answer.isTotal" v-cloak>
      <van-sticky>
        <div class="fixed aui-bg-f" style="bottom: 0" id="fixed">
            <div class="content">
                <van-row>
                    <van-col span="16" class="aui-ftn14 aui-text-f lt">
                        商家已存{{answer.data.total}}元保证金
                    </van-col>
					<van-col span="8" class="aui-text-f aui-text-center aui-ftn16 time_btn" v-if="answer.data.exittime && !answer.data.order_id" v-cloak>
					  <van-count-down :time="answer.data.exittime*1000" @finish="fnGetDetailData"/>
					</van-col>
                    <van-col span="8" class="rt aui-text-f aui-text-center aui-ftn16 aui-bg-red" @click="fnApply" v-else-if="!answer.data.order_id" v-cloak>
                        抢资格
                    </van-col>
                    <van-col span="8" class="rt aui-text-f aui-text-center aui-ftn16 aui-bg-red" @click="fnCheck(2)" v-else-if="answer.data.status == 1 && answer.data.order_id" v-cloak>
                        填写答案
                    </van-col>
                    <van-col span="8" class="rt aui-text-f aui-text-center aui-ftn16 time_btn" v-else-if="answer.data.status  == 2 && answer.data.order_id" v-cloak>
                        作答完成
                    </van-col>
                    
                </van-row>
            </div>
        </div>
      </van-sticky>
        <!-- 选择淘宝帐号 -->
        <div class="sz_taobao" v-if="answer.isLogin && answer.isApply" v-cloak>
            <div class="bg"></div>
            <div class="sz_taobao_content">
                <div class="title aui-text-center aui-text-f aui-bg-red">
                    <span class="aui-ftn14">选择</span>
                    <span class="aui-ftn16">找答案的</span>
                    <span class="aui-ftn14">帐号</span>
                </div>
                <div class="content aui-bg-f aui-padded-10">
                    <div class="choose-item aui-padded-b-5 aui-padded-t-5" v-for="(item, index) in answer.data.buynum" @click="select_user = item">
                        <van-row class="aui-text-red">
                            <van-col span='20'>
                                <span class="aui-ftn16" v-text="item.username">
                                </span>
                                <div class="aui-ftn12" v-text="item.text"></div>
                            </van-col>
                            <van-col span="4" class="aui-text-right" v-if="item.id == select_user.id" v-cloak>
                                <i class="iconfont icon-gou aui-ftn12"></i>
                            </van-col>
                        </van-row>
                    </div>
                    <button class="add_btn aui-text-f aui-ftn14 aui-bg-red aui-text-center" style="border: 0" @click="fnOpenAddUser">+添加买号</button>
                    <div class="txt aui-ftn12 aui-text-9 aui-padded-t-10">
                        请用申请的帐号去搜索答案
                    </div>
                </div>
                <div class="bb aui-text-center">
                    <van-row>
                        <van-col span="12" class="btn aui-text-f aui-ftn16 aui-bg-red confirm_btn" @click="fnSelectUser">
                            确定
                        </van-col>
                        <van-col span="12" class="btn aui-text-7 aui-ftn16 aui-bg-f close_btn" @click="fnApply">
                            关闭
                        </van-col>
                    </van-row>
                </div>
            </div>

        </div>
    </div>
    <div v-if="answer.isTotal" v-cloak>
        <div class="no-data aui-text-center aui-text-9">
            <i class="iconfont icon-lujing1161"></i>
            <div class="aui-ftn15" v-text="answer.no_data">
            </div>
        </div>
    </div>
    <!-- 核对店铺名或输入订单号 -->
    <van-dialog v-model="check.show" :title="check.title" @confirm="fnCheckConfirm" show-cancel-button>
      <div class="check aui-padded-15">
        <input type="text" v-model="check.input" :placeholder="check.name" class="aui-text-center aui-ftn14 aui-text-3">
      </div>
    </van-dialog>
  </div>
</template>

<script>
  import Answer from '../../service/answer.js'
  export default {
    data () {
      return {
        tab: {
            cur: 0,
            desc: '',
            items: []
        },
        users: [],
        select_user: {},
        check: {title: '', input: '', show: false, name: ''},
        answer: {
            daan: '',
            isApply: false,
            isLogin: true,
            data: {},
            isTotal: false,
            no_data: ''
        }
      }
    },
    mounted() {
      this.init()
    },
    methods: {
      init: function() {
		  this.answer.isLogin = this.$store.state.uid ? true : false;
          this.fnGetDetailData()
          this.fnGetAnswerLog()
      },
      fnGetDetailData: function() {
        Answer.fnGetAnswerDetail({id: this.$route.params.id, uid: this.$store.state.uid ? this.$store.state.uid : ''}).then(res => {
          if (res) {
              if (res.status) {
                  this.answer.data = res.data;
                  this.select_user = this.answer.data.buynum.length > 0 ? this.answer.data.buynum[0] : {};
              } else {
                  this.answer.no_data = res.msg;
                  this.answer.isTotal = true;
              }
          }
        })
      },
      // 作答记录
      fnGetAnswerLog: function() {
        Answer.fnGetAnswerLog({qid: this.$route.params.id}).then(res => {
          if (res && res.status) {
              this.users = res.data;
          }
        })
      },
      // 换个关键词
      fnChangeKeyWord: function() {
        Answer.fnChangeKeyword({goods_id: this.answer.data.id, keyword: this.answer.data.keyword.key, type: 'question', isToken: true}).then(res => {
          console.log(res)
          if (res) {
              if (res.status) {
                  this.answer.data.keyword = res.data;
              }
          }
        })
      },
      fnCheck:function(type) {
        this.check.type = type;
        switch(type) {
          case 1:
            this.check.title = "填写要核对的店铺名";
            this.check.name = '店铺名'
          break;
          case 2:
            // if (this.answer.daan) this.check.input = this.answer.daan;
            this.check.title = "填写答案";
            this.check.name = '答案'
          break;
        }
        this.check.show = true;
      },
      fnCheckConfirm: function() {
        switch(this.check.type) {
          case 1:
            if (!this.check.input) {
              this.utils.fnMsg('请填写要核对的店铺名')
            } else {
              this.fnCheckShop()
            }
          break;
          case 2:
            if (!this.check.input) {
              this.utils.fnMsg('请填写答案')
            } else {
              this.fnAnswerData(this.check.input);
            }
          break;
        }
      },
      // 核对店铺名
      fnCheckShop: function() {
        Answer.fnCheckShopName({goods_id: this.answer.data.id, storename: this.check.input, type: 'question', isToken: true}).then(res => {
          if (res) {
            this.utils.fnMsg(res.msg)
			this.check.input = '';
            if (res.status) {
                this.answer.data.storename = this.check.input;
            }
          }
        })
      },
      // 预览图片
      fnPreview: function(path) {
        this.utils.fnPreviewPic([path])

      },
      fnOpenLogin: function() {
        this.utils.fnOpenCommon(this, {name: 'login', query: {from: 'answer_detail', active: 0}, params: {id: this.$route.params.id}})
      },
      fnOpenRegister: function() {
        this.utils.fnOpenCommon(this, {name: 'login', query: {from: 'answer_detail', active: 1}, params: {id: this.$route.params.id}})
      },
      // 抢资格
      fnApply: function() {
          if (this.answer.isLogin && this.$store.state.uid) {
              this.answer.isApply = !this.answer.isApply
          } else {
              this.utils.fnMsg('请先登录');
              var vm = this;
              setTimeout(function() {
                  vm.fnOpenLogin()
              }, 2000)
          }
      },
      // 选择淘宝帐号
      fnSelectUser: function() {
          if (!this.select_user.id) {
              var txt = ''
              if (this.answer.data.downtype == 1 || this.answer.data.downtype == 2 || this.answer.data.downtype == 5) {
                  txt = '淘宝天猫阿里'
              } else if (this.answer.data.downtype == 3) {
                  txt = '京东';
              } else if (this.answer.data.downtype == 4) {
                  txt = '拼多多';
              }
              this.$dialog.alert({
                message: '请选择'+txt+'帐号',
              });
          } else {
              Answer.fnApplyAnswer({qid: this.answer.data.id, uid: this.$store.state.uid, buynum: this.select_user.username, isToken: true}).then(res => {
                if (res) {
                    this.fnApply()
                    this.utils.fnMsg(res.msg);
					this.check.input = '';
                    if (res.status) {
                        this.fnGetDetailData();
                        this.fnCheck(2)
                    }
                }
              })
          }
      },
      // 填写答案
      fnAnswerData: function(answer) {
        Answer.fnSetAnswer({'qid': this.answer.data.id, uid: this.$store.state.uid, answer: answer, isToken: true}).then(res => {
          if (res) {
              this.utils.fnMsg(res.msg)
              if (res.status) {
				  var vm = this;
				  setTimeout(function() {
					vm.check.input = '';
					vm.fnGetDetailData()  
				  }, 2000)
              } else {
				  this.check.input = '';
			  }
          }
        })
      },
      // 添加买号
      fnOpenAddUser: function() {
        var type = 0;
        if (this.answer.data.downtype == 1 || this.answer.data.downtype == 2 || this.answer.data.downtype == 5) {
           type = 0;
        } else if (this.answer.data.downtype == 3) {
            type = 1;
        } else if (this.answer.data.downtype == 4) {
            type = 2;
        }
        this.utils.fnOpenCommon(this, {name: 'add_user', query: {type: type, title: '添加买号'}})
      },
      fnCopyText: function(el) {
        let vm = this;
        let clipboard = new this.clipboard(el);
        clipboard.on('success', function () {
          vm.utils.fnMsg("复制成功")
        });
        clipboard.on('error', function () {
          vm.utils.fnMsg("复制失败")
        });
      }
    }
  }
</script>

<style scoped>
  body,html {
  	background-color: #f5f5f5
  }

  #main {
    padding-bottom: 50px;
  }

  div.check input {
      border: 1px solid #eee;
      border-radius: 3px;
      height: 40px;
      line-height: 40px;
      width: 90%!important;
      margin: 0 auto;
	  display: block;
	  background-color: #fff;
  }

 .back {
  	position: fixed;
  	left: 0;
  	z-index: 99
  }

  .back .back-cont {
  	width: 36px;
  	height: 36px;
  	line-height: 36px;
  	border-radius: 50%
  }

  .banner .slide-img {
  	width: 100%;
    height: 350px;
  	background-size: cover;
  	background-repeat: no-repeat;
  	background-position: center center
  }

  .banner .swiper-container {
  	--swiper-pagination-color: var(--pink)
  }

  div.content .top {
  	border-bottom: 1px solid #eee
  }

  div.content .top .name {
  	padding-bottom: 15px;
  	display: -ms-flexbox;
  	display: -webkit-flex;
  	display: flex;
  	-ms-flex-direction: row;
  	-webkit-flex-direction: row;
  	flex-direction: row;
  	-ms-flex-pack: start;
  	-webkit-justify-content: flex-start;
  	justify-content: flex-start
  }

    div.content .top .name img {
      width: 18px;
      height: 18px;
    }

  div.content .bottom {
  	padding: 15px;
  	margin-bottom: 10px
  }

  .tab .tab_top {
  	height: 36px;
  	line-height: 36px
  }

  .tab .tab_top .item {
  	border-bottom: 1px solid #eee
  }

  .tab .tab_top .item.active {
  	color: var(--pink)!important;
  	border-bottom-color: var(--pink)
  }

  .tab .tab_record {
  	padding: 15px 15px 15px 5px
  }

  .tab .tab_record .item {
  	padding: 0 0 10px 10px
  }

  .tab .tab_record .item .avatar {
  	width: 40px;
  	height: 40px;
  	border-radius: 50%;
  	margin: auto;
  	background-position: center center;
  	background-repeat: no-repeat;
  	background-size: cover
  }

  .tab .tab_cont .tab_desc .title {
  	font-size: 14px;
  }

  .tab .tab_cont .tab_desc .desc {
  	font-size: 14px;
    max-height: 100%;
  }

  .tab .sign {
  	padding: 50px 25px
  }

  .tab .sign .login_btn,.tab .sign .register_btn {
  	width: 100px;
  	height: 36px;
  	line-height: 36px;
  	border-radius: 4px;
  	margin: auto
  }

  .tab .sign .login_btn {
  	border: 1px solid var(--pink)
  }

  .fixed {
  	z-index: 1100;
    transform: translateZ(0);
  }

  .fixed .content {
  	height: 50px;
  	line-height: 50px
  }

  .fixed .content .btn {
  	height: 50px;
  	line-height: 50px;
  	border-radius: 0;
    font-size: 16px;
    max-height: 100%;
  }

  .fixed .content .lt {
  	background-color: #444;
  	padding-left: 20px
  }

  .fixed .content .time_btn {
  	background-color: #000
  }
  .van-count-down {
    height: 50px;
    line-height: 50px;
    color: #fff;
    font-size: 16px;
  }

  .sz_taobao .bg {
  	position: fixed;
  	top: 0;
  	right: 0;
  	bottom: 0;
  	left: 0;
  	z-index: 100;
  	background-color: rgba(0,0,0,.5)
  }

  .sz_taobao .sz_taobao_content {
  	position: fixed;
  	top: 50%;
  	right: 10%;
  	left: 10%;
  	z-index: 101;
  	-webkit-transform: translateY(-50%);
  	-moz-transform: translateY(-50%);
  	-ms-transform: translateY(-50%);
  	-o-transform: translateY(-50%);
  	transform: translateY(-50%);
  	background-color: #fff;
  	border-radius: 6px
  }

  .sz_taobao .sz_taobao_content .title {
  	height: 36px;
  	line-height: 36px;
  	border-radius: 6px 6px 0 0
  }

  .sz_taobao .sz_taobao_content .content .choose-item {
  	border-bottom: 1px solid #eee
  }

  .sz_taobao .sz_taobao_content .content .add_btn {
  	border-radius: 4px;
  	padding: 0 10px;
  	margin-top: 10px
  }

  .sz_taobao .sz_taobao_content .bb .btn {
  	height: 40px;
  	line-height: 40px;
  	border-top: 1px solid #eee
  }

  .sz_taobao .sz_taobao_content .bb .confirm_btn {
  	border-radius: 0 0 0 5px
  }

  .sz_taobao .sz_taobao_content .bb .close_btn {
  	border-radius: 0 0 5px 0
  }
</style>
